bitkeeper revision 1.1597 (429b4898xNVUuBPMVXKa545qSx7i7A)
authorsmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>
Mon, 30 May 2005 17:08:40 +0000 (17:08 +0000)
committersmh22@firebug.cl.cam.ac.uk <smh22@firebug.cl.cam.ac.uk>
Mon, 30 May 2005 17:08:40 +0000 (17:08 +0000)
fix xm vif-list and xm vbd-list (modulo error reporting for domain 0)

Signed-off-by: Steven Hand <steven@xensource.com>
tools/python/xen/xend/XendClient.py
tools/python/xen/xend/XendDomain.py
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/server/SrvDomain.py

index 4aa12ca930a9f4e4559542c380174db2b4e66306..012a8b8dcc6aec9713f2c1cc96c90bb3dda7b30a 100644 (file)
@@ -279,12 +279,12 @@ class Xend:
                               'period'  : period })
 
     def xend_domain_devices(self, id, type):
-        return self.xendGet(self.domainurl(id),
+        return self.xendPost(self.domainurl(id),
                              {'op'      : 'devices',
                               'type'    : type })
 
     def xend_domain_device(self, id, type, idx):
-        return self.xendGet(self.domainurl(id),
+        return self.xendPost(self.domainurl(id),
                              {'op'      : 'device',
                               'type'    : type,
                               'idx'     : idx })
index 8bc5092e18c31fb0b4920961513c4aa214aa484d..94c299c791ac993c5ab25f973e3d515f16c12af0 100644 (file)
@@ -637,14 +637,14 @@ class XendDomain:
         return val
 
     def domain_devtype_ls(self, id, type):
-        """Get list of device indexes for a domain.
+        """Get list of device sxprs for a domain.
 
         @param id:  domain
         @param type: device type
-        @return: device indexes
+        @return: device sxprs
         """
         dominfo = self.domain_lookup(id)
-        return dominfo.getDeviceIndexes(type)
+        return dominfo.getDeviceSxprs(type)
 
     def domain_devtype_get(self, id, type, idx):
         """Get a device from a domain.
index a243867ebd5bd86ff63dd85b5eabc9b401b7b191..ac0d4b63574766249ec65e236cfca1e8166e6d45 100644 (file)
@@ -25,7 +25,7 @@ from server import messages
 from xen.xend.XendBootloader import bootloader
 import sxp
 from XendLogging import log
-from XendError import VmError
+from XendError import XendError, VmError
 from XendRoot import get_component
 
 from PrettyPrint import prettyprintstring
@@ -555,8 +555,7 @@ class XendDomainInfo:
         if self.memory is None:
             raise VmError('missing memory size')
         cpu = sxp.child_value(config, 'cpu')
-        if self.recreate and self.dom and cpu is not None:
-            #xc.domain_pincpu(self.dom, int(cpu))
+        if self.recreate and self.dom and cpu is not None and cpu > 0:
             xc.domain_pincpu(self.dom, 0, 1<<int(cpu))
         try:
             image = sxp.child_value(self.config, 'image')
index eb05c17d36e53b9365ddbd2354b174e0be9ec41a..c9cf4fe60344ad87feb7cce48c1c56254fa99780 100644 (file)
@@ -185,8 +185,13 @@ class SrvDomain(SrvDir):
         
     def render_GET(self, req):
         op = req.args.get('op')
-        if op and op[0] in ['vifs', 'vif', 'vbds', 'vbd', 'mem_target_set']:
-            return self.perform(req)
+        #
+        # XXX SMH: below may be useful once again if we ever try to get
+        # the raw 'web' interface to xend working once more. But for now
+        # is useless and out of date (i.e. no ops called 'v???' anymore).
+        #
+        # if op and op[0] in ['vifs', 'vif', 'vbds', 'vbd', 'mem_target_set']:
+        #    return self.perform(req)
         if self.use_sxp(req):
             req.setHeader("Content-Type", sxp.mime_type)
             sxp.show(self.dom.sxpr(), out=req)